import { lazy } from "react";
import Car from "../views/car/Car";
import Detail from "../views/detail/Detail";
import Home from "../views/home/Home";
import Login from "../views/login/Login";
import My from "../views/my/My";
import { Navigate } from "react-router-dom";
import AuthRoute from "../components/AuthRoute";
import Search from "../views/search/search";
import Address from "../views/address/Address";
import Register from "../views/login/Register";
import Step1 from "../views/login/Step1";
import Step2 from '../views/login/Step2'
import Step3 from '../views/login/Step3'
import Order from "../views/order/Order";
export const route = [
    {
        path:"/home",
        element:<Home></Home>
    },
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/my",
        element:<My></My>
    },
    {
        path:"/car",
        element:<AuthRoute><Car></Car></AuthRoute>
    },
    {
        path:"/address",
        element:<Address></Address>
    },
    {
        path:"/search",
        element:<Search></Search>
    },
    {
        path:"/order",
        element:<Order></Order>
    },
    {
        path:"/register",
        element:<Register></Register>,
        children:[
            {
                path:'step1',
                element:<Step1></Step1>
            },
            {
                path:'step2/:tel',
                element:<Step2></Step2>
            },
            {
                path:'step3/:tel',
                element:<Step3></Step3>
            },
        ]
    },
    {
        path:"/detail/:proid",
        element:<Detail></Detail>
    },
    {
        path:"/",
        element:<Navigate to='/home'></Navigate>
    }
]